<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>详情</title>
    <meta
      name="viewport"
      content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"
    />
    <link href="../../../../css/mui.min.css" rel="stylesheet" />
    <link href="../../css/common.css" rel="stylesheet" />
    <link href="../../css/helper.css" rel="stylesheet" />
    <style>
      .mui-content {
        padding-top: 61px !important;
        padding-left: 13px;
        padding-right: 13px;
        margin-bottom: 15px;
      }
      .mui-content p {
        text-align: justify;
      }

      .file-pre-box {
        height: 443px;
        background: #f5f6f7;
        border: 1px solid #034880;
      }

      .file-pre {
        height: 443px;
        padding-left: 20px;
        padding-right: 20px;
        background: #f5f6f7;
        border: 1px solid #034880;
      }

      .img-tool-box {
        height: inherit;
        min-width: 33px;
      }

      .img-tool {
        width: 19px;
        height: 19px;
        margin-top: 10px;
      }
    </style>
  </head>

  <body>
    <div id="container" v-cloak>
      <header class="mui-bar mui-bar-nav">
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
        <h1 class="mui-title">详情</h1>
        <div class="img-tool-box">
          <img
            src="../../img/xiazai.png"
            class="img-tool fr"
            style="margin-left: 13px"
          />
          <img
            src="../../img/shoucang_moren.png"
            class="img-tool fr"
            style="margin-left: 13px"
          />
        </div>
      </header>
      <div class="mui-content">
        <p>
          描述：
          <br />
          {{detils[0].fileDescribe}}
        </p>
        <div class="file-pre">
          <h4 style="text-align: center">{{detils[0].title}}</h4>
          <div class="fileimg">
            <img :src="detils[0].fileAddres" alt="" />
          </div>
        </div>
      </div>
    </div>
    <script src="../../../../js/mui.js"></script>
    <script
      type="text/javascript"
      src="../../../../js/jquery-3.2.1.min.js"
    ></script>
    <script src="../../../../js/vue.js"></script>
    <script src="../../js/mkeyplus.base.js"></script>
    <script src="../../js/sqlite.js"></script>
    <script type="text/javascript">
      mui.init()
      if (window.plus) {
        plusready()
      } else {
        document.addEventListener("plusready", plusready, false)
      }

      function plusready() {
        var self = plus.webview.currentWebview()
        var ids = self.idss
        var type = self.types
        console.log("ssss1", self)
        console.log("ssss", ids, type)
        mui.DB.openSqlite()
        // 标准规范库
        if (type == "1") {
          let tech = [
            {
              key: "id",
              value: ids,
            },
          ]
          mui.DB.selectTableData("dataStand", tech)
            .then((res) => {
              console.log("表21", res)
              vm.detils = res
            })
            .catch((error) => {
              console.log(error)
            })
        } else if (type == "2") {
          //设备资料库
          let tech = [
            {
              key: "id",
              value: ids,
            },
          ]
          mui.DB.selectTableData("dataDevice", tech)
            .then((res) => {
              console.log("表2", res)
              vm.detils = res
            })
            .catch((error) => {
              console.log(error)
            })
        } else if (type == "3") {
          //技术交流
          console.log("技术交流11")
          let tech = [
            {
              key: "id",
              value: ids,
            },
          ]
          console.log("技术交流", tech)
          mui.DB.selectTableData("technology", tech)
            .then((res) => {
              console.log("表2", res)
              vm.detils = res
            })
            .catch((error) => {
              console.log(error)
            })
        } else if (type == 4) {
          //故障案例集
          let tech = [
            {
              key: "id",
              value: ids,
            },
          ]
          mui.DB.selectTableData("dataFaults", tech)
            .then((res) => {
              console.log("表2", res)
              vm.detils = res
            })
            .catch((error) => {
              console.log(error)
            })
        }
        // mui.DB.selectTableData('detailsIds').then(res=>{
        //   console.log('表210',res)
        //   var ids=res[0].id
        //   var type = res[0].type

        // }).catch(error=>{
        //   console.log(error)
        // })
      }

      let vm = new Vue({
        el: "#container",
        data: {
          form: {
            page: 1,
            size: 20,
            system: "APP",
            status: 1,
          },
          ids: "",
          type: "",
          detils: {},
        },
        created: function () {
          // this.getDetils()
        },
        methods: {
          getDetils() {
            // let than=this;
            // mui.baseApp.httpRequst("post", "/app/api/knowledge/faultCase/detail/"+ids,{}, function(data){
            //   console.log('12',data.data)
            //   than.detils=data.data
            //   // plus.nativeUI.closeWaiting();
            // }, function() {
            //   // plus.nativeUI.closeWaiting()
            //   console.log("获取数据失败1");
            // })
          },
        },
      })
    </script>
  </body>
</html>
